home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group01a.txt / 000054_icon-group-sender _Mon Jun 12 08:47:19 2000.msg < prev    next >
Internet Message Format  |  2002-01-03  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id IAA19743
  4.     for icon-group-addresses; Mon, 12 Jun 2000 08:45:53 -0700 (MST)
  5. Message-Id: <200006121545.IAA19743@baskerville.CS.Arizona.EDU>
  6. From: "Frank J. Lhota" <NOSPAM.Frank.Lhota@lexma.meitech.com>
  7. X-Newsgroups: comp.lang.icon
  8. Subject: User defined operators for Icon
  9. X-Priority: 3
  10. X-MSMail-Priority: Normal
  11. X-Newsreader: Microsoft Outlook Express 5.00.2919.6600
  12. X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600
  13. Date: Tue, 6 Jun 2000 10:39:33 -0000
  14. X-Trace: client 960302410 38.163.203.81 (Tue, 06 Jun 2000 10:40:10 EDT)
  15. To: icon-group@optima.CS.Arizona.EDU
  16. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  17. Status: RO
  18. Content-Length: 1042
  19.  
  20. In the thread on a Unicode version of Icon, a topic came up that deserves
  21. more investigation. Currently, an Icon programmer can create new types in
  22. Icon using a record declaration, e.g.
  23.  
  24.     record complex( x, y )
  25.  
  26. The programmer can then write new procedures that work with the new type.
  27. This ability to create new types is quite useful, but extending the types in
  28. Icon is not as convenient as it could be. It is hard to integrate the new
  29. type with the others due to the following reasons:
  30.  
  31.  
  32. 1.    You cannot (re)define the primitive operators, such as "*", "++", or
  33. "<", for a record type;
  34. 2.    You cannot define implicit /explicit type conversions between a record
  35. type and the existing types; and
  36. 3.    You cannot define the behavior of functions such as image and write
  37. for the new record type.
  38.  
  39. Languages such as C++ and Ada permit the programmer to define the behavior
  40. of operators and predefined functions for user defined types. Would it be
  41. desirable to add such a capacity to Icon? If so, what would this facility
  42. look like?
  43.  
  44.  
  45.  
  46.  
  47.  
  48.